package net.worldscale.xp.wslib.urm.util;

import java.util.Enumeration;
import java.util.Vector;

import net.worldscale.xp.wslib.urm.AppManager;
import net.worldscale.xp.wslib.urm.IAppLoader;

public abstract class DefaultAppLoader implements IAppLoader {

	private final Vector<String> mSupports = new Vector<String>();

	public DefaultAppLoader() {
	}

	protected void addSupportedType(String mime) {
		if (mime != null)
			this.mSupports.addElement(mime);
	}

	@Override
	public boolean isSupport(String mime) {
		return this.mSupports.contains(mime);
	}

	@Override
	public void regSelf(AppManager appMan) {
		for (final Enumeration<String> enu = this.mSupports.elements(); enu
				.hasMoreElements();) {
			final String mime = enu.nextElement();
			appMan.regAppLoader(this, mime);
		}
	}

}
